package com.phome.doAction;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import com.phome.iservice.StudentService;
import com.phome.model.Student;
import com.phome.type.FindType;

/**
 * 
 * 学生控制层登录页面
 * @author ma
 *
 */
@Controller("studentRegisterAction")
public class StudentRegisterAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Student student;
	
	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}
	
	@Resource(name="ss")
	private StudentService<Student> ss;
	private boolean isok = false;

	public String register(){
		System.out.println("获取到页面的数据" + student.toString());
		isok = ss.register(FindType.NAME,student);
		
		if(isok == true){
			
			return Action.SUCCESS;
		}
		return Action.ERROR;
	}
}
